﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace LynxBlogAPI.Models.Mapping
{
    public class PageCommentMap : EntityTypeConfiguration<PageComment>
    {
        public PageCommentMap()
        {
            this.HasKey(t => t.commentid);

            this.Property(t => t.commentid).HasColumnName("CommentId").HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);
            this.Property(t => t.pageid).HasColumnName("PageId").IsRequired();
            this.Property(t => t.username).HasColumnName("UserName").HasMaxLength(100).IsRequired();
            this.Property(t => t.ipaddress).HasColumnName("IpAddress").HasMaxLength(50).IsRequired();
            this.Property(t => t.userlink).HasColumnName("UserLink").HasMaxLength(50).IsOptional();
            this.Property(t => t.comment).HasColumnName("Comment").IsRequired();
            this.Property(t => t.datecreated).HasColumnName("DateCreated").IsRequired();
            this.Property(t => t.isapproved).HasColumnName("IsApproved").IsRequired();
            this.Property(t => t.inappropriateflagcnt).HasColumnName("InappropriateFlagCnt").IsOptional();
            this.Property(t => t.flagusers).HasColumnName("FlagUser").HasMaxLength(2000).IsOptional();
            this.Property(t => t.isdeleted).HasColumnName("IsDeleted").IsRequired();
            this.ToTable("tblPageComment");
        }    }
}